import Layout from '@/layout/index.vue'

const asyncRoutes = [
  {
    path: '/activity',
    name: ' Activity',
    component: Layout,
    meta: {
      title: '活动管理',
      icon: 'nav-icon icon-activity',
      resourceId: 'route:/web/activity-management/',
    },
    children: [
      {
        path: '/activity/list',
        name: 'ActivityList',
        component: () => import('@/views/activity/activityList'),
        meta: {
          title: '电站活动',
          resourceId: 'route:/web/activity-management/activityList-management/',
        },
      },
      {
        path: '/activity/add',
        name: 'ActivityAdd',
        component: () => import('@/views/activity/activityAdd'),
        hidden: true,
        meta: {
          title: '新增活动',
          resourceId:
            'route:/web/activity-management/activityList-management/activityCreate-management/',
          activeMenu: '/activity',
        },
      },
      {
        path: '/activity/detail/:actId/:actType',
        name: 'ActivityDetail',
        hidden: true,
        component: () => import('@/views/activity/activityDetail'),
        meta: {
          title: '活动详情',
          resourceId:
            'route:/web/activity-management/activityList-management/activityDetail-management/',
          activeMenu: '/activity',
          key: (route) => `${route.params.actId}${route.params.actType}`,
        },
      },
      {
        path: '/activity/edit/:actId',
        name: 'ActivityEdit',
        hidden: true,
        component: () => import('@/views/activity/activityAdd'),
        meta: {
          title: '编辑活动',
          resourceId:
            'route:/web/activity-management/activityList-management/activityCreate-management/',
          key: (route) => `${route.params.actId}`,
        },
      },
      {
        path: '/activity/advertList',
        name: 'AdvertList',
        component: () => import('@/views/activity/advertList'),
        meta: {
          title: '电站广告',
          resourceId: 'route:/web/activity-management/advert-management/',
        },
      },
      {
        path: '/activity/advertAdd',
        name: 'AdvertAdd',
        hidden: true,
        component: () => import('@/views/activity/advertDetail'),
        meta: {
          title: '新增电站广告',
          resourceId:
            'route:/web/activity-management/advert-management/advertCreate-management/',
        },
      },
      {
        path: '/activity/advertEdit/:advertId',
        name: 'AdvertEdit',
        hidden: true,
        component: () => import('@/views/activity/advertDetail'),
        meta: {
          title: '编辑电站广告',
          resourceId:
            'route:/web/activity-management/advert-management/advertCreate-management/',
          activeMenu: '/activity',
          key: (route) => `${route.params.advertId}`,
        },
      },
      {
        path: '/activity/advertDetail/:advertId',
        name: 'AdvertDetail',
        hidden: true,
        component: () => import('@/views/activity/advertDetail'),
        meta: {
          title: '电站广告详情',
          resourceId:
            'route:/web/activity-management/advert-management/advertDetail-management/',
          activeMenu: '/activity',
          key: (route) => `${route.params.advertId}`,
        },
      },
      {
        path: '/activity/advertStatistics/:advertId',
        name: 'AdvertStatistics',
        hidden: true,
        component: () => import('@/views/activity/advertStatistics'),
        meta: {
          title: '电站广告统计',
          resourceId:
            'route:/web/activity-management/advert-management/advertStatistic-management/',
          activeMenu: '/activity',
          key: (route) => `${route.params.advertId}`,
        },
      },
      {
        path: '/activity/externalList',
        name: 'ExternalActivityList',
        component: () => import('@/views/activity/externalActivityList'),
        meta: {
          title: '外部活动',
          resourceId:
            'route:/web/activity-management/externalActivity-management/',
        },
      },
      {
        path: '/activity/externalDetail/:exActId',
        name: 'ExternalActivityDetail',
        hidden: true,
        component: () => import('@/views/activity/externalActivityDetail'),
        meta: {
          title: '外部活动详情',
          resourceId:
            'route:/web/activity-management/externalActivity-management/detail/',
          activeMenu: '/activity',
          key: (route) => `${route.params.exActId}`,
        },
      },
      {
        path: '/activity/externalAdd',
        name: 'ExternalActivityAdd',
        component: () => import('@/views/activity/externalActivityAdd'),
        hidden: true,
        meta: {
          title: '新增外部活动',
          resourceId:
            'route:/web/activity-management/externalActivity-management/createOrUpdate/',
          activeMenu: '/activity',
        },
      },
      {
        path: '/activity/externalEdit/:exActId',
        name: 'ExternalActivityEdit',
        hidden: true,
        component: () => import('@/views/activity/externalActivityAdd'),
        meta: {
          title: '编辑外部活动',
          roles: ['AGENT', 'OPERATORS'],
          activeMenu: '/activity',
        },
      },
      {
        path: '/activity/externalCopy/:exActId',
        name: 'ExternalActivityCopy',
        component: () => import('@/views/activity/externalActivityAdd'),
        hidden: true,
        meta: {
          title: '复制活动',
          resourceId:
            'route:/web/activity-management/externalActivity-management/createOrUpdate/',
          activeMenu: '/activity',
          key: (route) => `${route.params.exActId}`,
        },
      },
    ],
  },
]
export default asyncRoutes
